//搜索旋转排序数组中的最⼩值（medium）
public class leetcode153 {
    public int findMin(int[] nums) {
        int tar=nums[nums.length-1];
        int left=0;
        int right=nums.length-1;
        while(left<right){
            int mid=left+(right-left)/2;
            if(nums[mid]>tar){
                left=mid+1;
            }else{
                right=mid;
            }
        }
        return nums[left];
    }
}
